import React, { Component } from 'react'
import axios from 'axios'
export default class App extends Component {
    //请求数据
    constructor() {
        super()
        //axios.get('url').then(res=>console.log(res)) 简写模式
        axios({
            url: 'https://m.maizuo.com/geteway?cityId=110110&ticketFlag=1&k=7406159',
            headers: {
                'X-Client-Info': '{"a":3000,"ch":"1002","v":"5.0.4","e": "16395416565231270166529", "bc": "110100"}',
                'X-Host': 'mail.film-ticket.cinema.list'
            },
            method: 'get'
        }).then(res => console.log(res))
    }
    state = {
        text: '111'
    }
    render() {
        return (
            <div>
                <input onInput={this.change} ></input>
                <div>axios</div>
            </div>
        )
    }
    change(event) {
        //输入框改变
        console.log(event)
        this.setState({
            text: '11'
        }, () => { console.log('更新成功后调用') })
    }
}
